import type { IQuery, TableConfig } from '@/api/config/types';
import { DeleteOutlined } from '@ant-design/icons-vue';
import type { ItemType } from 'ant-design-vue';

interface dbQuery {
  tableName: string;
}
let queryObj = {
  pageNum: 1,
  pageSize: 10,
  total: 0,
  tableName: '',
};

const resetQuery = () => {
  dbTable.value.query = {
    ...queryObj,
  };
};
export const dbTable = ref<TableConfig>({
  rowKey: 'tableName',
  data: [],
  loading: false,
  moduleName: 'db',
  viewMode: 'table',
  keys: [],
  query: queryObj,
  contextmenu: [
    {
      label: '删除',
      key: 'delete',
      icon: h(DeleteOutlined),
    },
  ],
  reset: resetQuery,
});

export const dbOperationList: ItemType[] = [];
